package com.mango.ch04;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
public class LocationCountMapper extends Mapper<LongWritable, Text, Text, Text> {
	private Text outputKey = new Text();
	private Text outputValue = new Text();

	@Override
	public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
		System.out.println("读取的二次数据" + value);
		String[] tokens = value.toString().split("\t");
		outputKey.set(tokens[0]);
		outputValue.set(tokens[1]);
		System.out.println("即将输出key=" + outputKey + " value" + outputValue);
		context.write(outputKey, outputValue);
	}

}
